package week_home_work02;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/23
 */
public class Demo80 {
    public static void main(String[] args) {
        //设计一个程序，输出1到n的数字的阶乘。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num = sc.nextInt();
        int sum = 1;
        for (int i = 1; i <= num; i++) {
            sum *= i;
            System.out.println(i + "的阶乘为:" + sum);
        }

    }
}
